package com.example.ujsfish.database;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.ujsfish.model.poolMap.PoolPoint;

import java.util.List;

@Dao
public interface PoolPointDao {
    @Insert
    void insertPoolPoints(PoolPoint... poolPoints);

    @Update
    void updatePoolPoints(PoolPoint... poolPoints);

    @Delete
    void deletePoolPoints(PoolPoint... poolPoints);

    @Query("DELETE FROM PoolPoint")
    void deleteAllPoolPoints();

    @Query("SELECT * FROM PoolPoint ORDER BY point_id DESC")
    List<PoolPoint> getAllPoolPoints();

    @Query("SELECT * FROM PoolPoint where pool_id IN (:pool_id)")
    List<PoolPoint> getPointByPoolId(int pool_id);
}
